package hku.cs.eclunuo.views;

import org.eclipse.core.resources.IProject;


public class Rank {
	private int index;
	private int rank;
	private String suspicious;
	private int line;
	private String klass;
	private String code;
	private IProject project;
	
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Rank(int index, int rank, String suspicious, int line, String klass, String code, IProject project) {
		super();
		this.index = index;
		this.rank = rank;
		this.suspicious = suspicious;
		this.line = line;
		this.klass = klass;
		this.code = code;
		this.project = project;
	}
	
	public Rank(int index, int rank, String suspicious, int line, String klass) {
		super();
		this.index = index;
		this.rank = rank;
		this.suspicious = suspicious;
		this.line = line;
		this.klass = klass;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public int getRank() {
		return rank;
	}

	public void setRank(int rank) {
		this.rank = rank;
	}

	public String getSuspicious() {
		return suspicious;
	}

	public void setSuspicious(String suspicious) {
		this.suspicious = suspicious;
	}

	public int getLine() {
		return line;
	}

	public void setLine(int line) {
		this.line = line;
	}

	public String getKlass() {
		return klass;
	}

	public void setKlass(String klass) {
		this.klass = klass;
	}
	
	public IProject getProject() {
		return project;
	}

	public void setProject(IProject project) {
		this.project = project;
	}

	public boolean equals(Object o) {
		if (!(o instanceof Rank))
			return false;

		Rank other= (Rank) o;
		String a = klass+":"+line;
		String b = other.getKlass()+":"+other.getLine();
		return (a.equals(b));
	}

	public int hashCode() {
		String a = klass+":"+line;
		return a.hashCode();
	}
}
